StringOps ActiveX Control Documentation
Version 1.0.08
by Ryan Grove - http://www.wonko.com/activex/
Last updated: 6/10/99
Description:
StringOps is a string manipulation OCX that automates various string operations for you, ranging in complexity from simple to advanced. Very easy to use and a massive time-saver if you play with strings a lot. Its possible uses include stripping HTML tags from web-formatted documents, finding text between delimiters, removing unwanted characters from a document, encrypting and decrypting text, etc.

Properties:

StillExecuting

 
StillExecuting
Design-time: No Access
Run-time: Read-only

 
This is a boolean (true or false) property that lets you know whether or not the control is busy executing an operation. If the control is busy, it returns true. You can use this to keep from causing fatal errors by trying to run two operations at once.

Example:
'Don't perform an operation if control is already busy
If StringOps1.StillExecuting Then Exit Sub

 

Methods:
Note: Examples are given only for some methods. Most of them are pretty straightforward.

Decrypt()
Encrypt()
GetAllAfter()
GetAllBefore()
GetDelimited()
Random()
Reverse()
ScriptKiddie()
StripDelimited()
StripPunctuation()
StripSingle()

 
Decrypt(sString, sKey)
Decrypts a string that has been previously encrypted using the
Encrypt() method.

  • sString: The string to randomize.
  • sKey: Numerical encryption key - any length (you must remember this!)

Example:
Dim strEncrypted As String
Dim strDecrypted As String

'Decrypt the secret message
strEncrypted = "]qx!pjyj(tq'ookj7!>/-"
strDecrypted = StringOps1.Decrypt(strSecret, "42318935862736559142")
MsgBox strDecrypted

 
Encrypt(sString, sKey)
Encrypts a string using a strong character-shifting type of key-based encryption. The text can then be decrypted using the
Decrypt() method. While this type of encryption is theoretically breakable, it would take a long time and a really powerful computer to do so. And remember, the longer your encryption key, the harder it is to break the code.

  • sString: The string to randomize.
  • sKey: Numerical encryption key - any length (you must remember this!)

 
GetAllAfter(sString, sDelimiter)
Returns all text in a string that is located after the first instance of the specified delimiter character(s).

  • sString: The source string.
  • sDelimiter: The delimiter that separates the string.

Example:
Dim strIncoming As String
Dim strMessage As String

'This returns the text "New message"
strIncoming = "212 irc.fubar.com Wonko42 :New message"
strMessage = StringOps1.GetAllAfter(strIncoming, ":")
MsgBox strMessage

 
GetAllBefore(sString, sDelimiter)
Returns all text in a string that is located before the first instance of the specified delimiter character(s).

  • sString: The source string.
  • sDelimiter: The delimiter that separates the string.

 
GetDelimited(sSearchString, ReturnCollection, sOpenDelimiter, sCloseDelimiter)
Returns a collection containing each instance of text between the two specified delimiters. The delimiters can be a set of multiple characters or a single character, and they can be two different characters or the same one repeated, it doesn't matter. Whatever's between them will be returned.

  • sSearchString: The string to search in.
  • ReturnCollection: The name of a collection that should be created with the results.
  • sOpenDelimiter: The opening delimiter (may be the same as the closing delimiter)
  • sCloseDelimiter: The closing delimiter (may be the same as the opening delimiter)

Example:
Dim strIncoming As String
Dim strMessage As String
Dim colReturn As New Collection

'This returns the text between the brackets
strIncoming = "Message: <You're late for the meeting!>"
StringOps1.GetDelimited strIncoming, colReturn, "<", ">"

 
Random(sString)
Rearranges the characters in the specified string in a random, undecipherable, nonsensical pattern.

  • sString: The string to randomize.

 
Reverse(sString)
Reverses the text in the specified string so that it reads backwards, right to left.

  • sString: The string to reverse.

 
ScriptKiddie(sString)
Converts a string to 'leet ScRiPt kIdDeE format. For all you prepubescent "h@x0rs" out there... :)

  • sString: The string to convert.

 
StripDelimited(sSearchString, sOpenDelimiter, sCloseDelimiter)
Searches a string for text between the specified delimiters and deletes the delimited text. (good for stripping HTML tags from documents)

  • sSearchString: The string to search in.
  • sOpenDelimiter: The opening delimiter (may be the same as the closing delimiter)
  • sCloseDelimiter: The closing delimiter (may be the same as the opening delimiter)

 
StripPunctuation(sString)
Removes all sentence punctuation from the specified string. The following characters will be removed: `!:;"',.?()

  • sString: The string to strip.

 
StripSingle(sSearchString, sStripChar)
Removes all occurances of the specified character(s) from a string.

  • sSearchString: The string to search in.
  • sStripChar: The character to strip.